home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Chapter Tutorials / CaseStudies / ch10.macromedia / spot.dcr / 00001.ls next >
Encoding:
Text File  |  1996-11-11  |  1.4 KB  |  67 lines

  1. global gRandomTimer, cSlotOffset, gSlotObjList, gNumOTimes, cBlurCastOffset, cBlurCastOffset2, gPicOffset, gStartTime, gCounter, gSlotsList, gSlotsFlag
  2.  
  3. on startMovie
  4.   set the randomSeed to the ticks
  5.   preLoadCast(1, 61)
  6.   setConstants()
  7.   setGlobals()
  8.   set gRandomTimer to random(5 * 60)
  9. end
  10.  
  11. on setConstants
  12.   set cSlotOffset to 10
  13.   set gPicOffset to 22
  14.   set cBlurCastOffset to 31
  15.   set cBlurCastOffset2 to 53
  16. end
  17.  
  18. on setGlobals
  19.   set gSlotsList to ListShuffler(4)
  20.   set gSlotObjList to []
  21.   repeat with x = 1 to 4
  22.     add(gSlotObjList, birth(script "Slot Parent Script", x))
  23.     puppetSprite(x + cSlotOffset, 1)
  24.   end repeat
  25.   set gCounter to 0
  26.   set gStartTime to the ticks
  27.   set gNumOTimes to 1
  28.   set gSlotsFlag to 0
  29. end
  30.  
  31. on animateSlots
  32.   repeat with t = 1 to 4
  33.     slotChanger(getAt(gSlotObjList, t))
  34.   end repeat
  35. end
  36.  
  37. on slotGame
  38.   repeat with t = 1 to 4
  39.     playSlotGame(getAt(gSlotObjList, t))
  40.   end repeat
  41. end
  42.  
  43. on yourSite
  44.   repeat with t = 1 to 4
  45.     thisIsYourSite(getAt(gSlotObjList, t))
  46.   end repeat
  47. end
  48.  
  49. on ListShuffler howMany
  50.   set shuffleList to []
  51.   repeat with x = 1 to howMany
  52.     addAt(shuffleList, x, x)
  53.   end repeat
  54.   repeat with x = 1 to howMany
  55.     set randVar to random(howMany)
  56.     set TempVar to getAt(shuffleList, x)
  57.     set a to getAt(shuffleList, randVar)
  58.     setAt(shuffleList, x, a)
  59.     setAt(shuffleList, randVar, TempVar)
  60.   end repeat
  61.   return shuffleList
  62. end
  63.  
  64. on goToNetPage
  65.   alert("Going to next page!")
  66. end
  67.